package com.bbx.api.gclient;

import org.json.JSONObject;

/**
 * 消息类型
 */
public class GMsg {
	//msg开头的都是消息里面的
	/**消息類型*/
	public  static String msg_evtype="evtype";
	public static String msg_status="status";
	/**消息里的具体内容*/
	public  static String msg_jmsg="jmsg";
	/**传递的用户ID*/
	public  static String msg_cid="cid";
	/**在线消息类型，1派单通知，2司机取消订单，3为已改派通知，4为重新登录通知*/
	public  static String msg_type="type";
	public  static String msg_data="data";
	public  static String msg_time="time";
	public  static String msg_msgs="msgs";
	public  static String msg_text="text";
	public  static String msg_list="list";
	public  static String msg_order_id="order_id";
	public  static String msg_position="position";
	public  static String msg_srvtype="srvtype";
	/**返回的状态*/
	public  static String msg_code ="code";
	//以下为在线通知类型
	public static final int ONLINE_XIADAN=202;
	
	/**新订单推送消息*/
	public static final int ONLINE_NEW_ORDER_TEST=100;      //市内新订单消息类型
	
	/**银行卡绑定结果通知*/
	public static final int BANKINFO_NOTIFY=88;      //银行卡绑定结果通知
	/**派单通知*/
	public static final int ONLINE_PAIDAN=1;
	public static final int OFFICAIL_ONLINE_PAIDAN=1001;
	/**司机取消通知*/
	public static final int ONLINE_CANCEL=2;
	public static final int OFFICAIL_ONLINE_CANCEL=1002;
	/**客服取消通知*/
	public static final int ONLINE_KF_CANCEL=20;
	/**客服取消通知*/
	public static final int ONLINE_KF_CANCEL_ORDER=23;
	/**该派通知*/
	public static final int ONLINE_GAIPAI=3;
	public static final int OFFICAIL_ONLINE_GAIPAI=1003;
	/**客服改派通知*/
	public static final int ONLINE_KF_GAIPAIL=24;
	/**司机改派通知*/
	public static final int ONLINE_SJ_GAIPAIL=21;
	/**客服改派通知*/
	public static final int ONLINE_KF_STANDY=51;
	/**客服改派通知*/
	public static final int ONLINE_KF_STANDY_CANCEL=50;

//	/**线下支付成功通知*/
//	public static final int ONLINE_OUTLINE_PAY_SUCC=80;
	/**线上支付成功通知*/
	public static final int ONLINE_ONLINE_PAY_SUCC=81;
	/**客服改价通知*/
	public static final int ONLINE_CHANGE_PRICE_BY_KF=82;
	/**客服改单通知*/
	public static final int ONLINE_CHANGE_ORDER_KF=83;
	/**客服改价通知（基本费用）*/
	public static final int ONLINE_CHANGE_BASEPRICE_BY_KF=84;
	/**客服上车通知*/
	public static final int ONLINE_ONCAR_BY_KF=5;
	/**客服下车通知*/
	public static final int ONLINE_OFFCAR_BY_KF=6;
	public static final int ONLINE_ONTLINE_PAY_SUCC=81;
	/**客服改价*/
	public static final int ONLINE_KF_CHANGE=82;
    /**客服改单*/
	public static final int ONLINE_KF_CHANGE_ORDER=83;
	/**客服改价*/
	public static final int ONLINE_KF_CHANGE_PRICE=84;
	/**客服改价通知乘客端（修改公式计价的超时长/里程费）*/
	public static final int ONLINE_KF_CHANGE_PRICE2=86;
	/**司机自助充值*/
	public static final int ONLINE_DRIVER_AUTORECHARGE=85;
	/**客服改价通知司机端（修改公式计价的超时长/里程费）*/
	public static final int ONLINE_KF_CHANGE_AUTOPRICE=86;
	
	/**重新登录通知*/
	public static final int ONLINE_RELOGIN=4;
	/**已上车*/
	public static final int ONLINE_ONCAR=5;
	public static final int OFFICAIL_ONLINE_ONCAR=1004;
	/**到达指定位置*/
	public static final int OFFICAIL_ONLINE_ARRIVE=1005;
	/**已下车，也是待支付界面*/
	public static final int ONLINE_OFFCAR=6;
	public static final int OFFICAIL_ONLINE_OFFCAR=1006;
	/**订单完成*/
	public static final int ONLINE_FINISH=7;
	public static final int OFFICAIL_ONLINE_FINISH=1081;
	/**司机发车*/
	public static final int ONLINE_START=99;
	/**订单繁忙*/
	public static final int ONLINE_BUSY=8;
	/**后台录单*/
	public static final int ONLINE_BG_ORDER=30;
	/**优惠劵入账通知*/
	public static final int ONLINE_ENTER_COUPON=40;
	/** 司机地理位置 */
	public static final int ONLINE_POSITION = 100;
	/**新的待审核订单*/
	public static final int ONLINE_NEW_UNPROCESSED = 200;
	/**订单审核结果*/
	public static final int ONLINE_UNPROCESSED_RESULT = 201;
	/**更改单程或往返*/
	public static final int OFFICAIL_ONLINE_ROUND_TRIP=1079;
	/**订单价格更新*/
	public static final int OFFICAIL_ONLINE_PRICE=1080;
	/**被AA的消息,或者通用消息*/
	public static final int OFFICAIL_AA=9999;
	/**市内超时消息*/
	public static final int ONLINE_SNTIMEOUT=25;
	/**司机数量*/
	public static final int ONLINE_DRIVERCN=71;
	/**市内预约变为即时*/
	public static final int ONLINE_SNTOQIANGDAN=70;
	/**分享优惠劵，对方领取通知*/
	public static final int ONLINE_SHARECOUPONSUC=50;
	/**自定义离线消息*/
	public static final int OFFLINE=10000;
	/**自定义活动消息*/
	public static final int ONLINE_ACTIVITY = 100000;
	/**自定义市内抢单消息*/
	public static final int ONLINE_SNQIANGDAN = 200000;
	
	public static final int SRVTYPE_PUSH = 10;
	public static final int SRVTYPE_KEEPALIVE = 20;
	public static final int SRVTYPE_GPS = 30;
	
	public static final int NOTIFY_lOGIN_OK = 2;
	public static final int NOTIFY_BE_lOGIN = 4;
	
	//下面为消息类型的对应类型，目前就2个，离校消息是自己定义的为字段sn = "push_offline"
	public static final int NOTIFY_TYPE_RESOPNE  =1;
	public static final int NOTIFY_TYPE_LOGIN_STATUS_CHANGE=0;//登陆状态
	public static final int NOTIFY_TYPE_ONLINE =10000;//在线消息
	public static final int NOTIFY_TYPE_ADV_HOT	= 700;
	public static final int NOTIFY_TYPE_ADV_NEARBY = 701;
	public static final int NOTIFY_TYPE_ADV_RECOMMEND = 702;
	/**司机位置*/
	public static final int NOTIFY_TYPE_DRIVER_LOCATION = 100;
	/**返回类型*/
	public int type;
	/**返回状态*/
	public int stauts;
	/**返回数据*/
	public Object data;
	/**返回的错误errorcode*/
	public String code;
	
	public String msg;
	
	public GMsg(String msg) {
		JSONObject j;
		try {
			this.msg = msg;
			j = new JSONObject (msg);		
           type = Integer.parseInt(j.getString(msg_evtype));
           if(type==0){//登录类型
        	 stauts=Integer.parseInt(j.getString(msg_status));
           }
     
           data=j;
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	/**新订单推送消息*/
	public static final int ONLINE_NEW_ORDER=100;//
	/**客服取消通知*/
	public static final int ONLINE_KF_CANCEL1=23;//
	/**客服上车通司机端*/
	public static final int ONLINE_KF_ONCAR=5;
	/**客服下车通司机端*/
	public static final int ONLINE_KF_OFFCAR=6;
	/**客服取消报班通知司机*/
	public static final int ONLINE_KF_CANCEL_StandBy=50;
	/**客服报班通知司机*/
	public static final int ONLINE_KF_StandBy=51;
	/**乘客线上支付成功通知*/
	public static final int ONLINE_KF_PAY_ONLINE=81;
	/**客服改价通司机端*/
	public static final int ONLINE_KF_CHANGE_Order_Price=82;
	
	/**公务车派单通知*/
	public static final int ONLINE_OFFICIAL_PAIDAN=1101;
	/**公务车订单取消*/
	public static final int ONLINE_OFFICIAL_CANCEL=1102;
	/**公务车订单改派*/
	public static final int ONLINE_OFFICIAL_GAIPAIL=1103;
	/**公务车订单支付完成*/
	public static final int ONLINE_OFFICIAL_PAY=1181;
	/**公务车订单评价*/
	public static final int ONLINE_OFFICIAL_COMMENT=1182;
	/**公务车文本消息*/
	public static final int ONLINE_OFFICIAL_TEXTMSG=9999;
}
